package com.lex.newbasketball.testbasefragmentactivity;

import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.widget.RelativeLayout;

import com.lex.newbasketball.R;
import com.lex.newbasketball.fragment.DiscoveryFragment;
import com.lex.newbasketball.fragment.MeFragment;
import com.lex.newbasketball.fragment.MessageFragment;
import com.lex.newbasketball.fragment.WonderFragment;
import com.sam.ui.base.activity.BaseFragmentActivity;
import com.sam.widget.button.StateBitmapImageButton;
import com.sam.widget.nav_bar.NavigationBar;

public class TestBaseFragmentActivity extends BaseFragmentActivity {

    @Override
    protected void initPageInfo() {

        NavigationBar.NavigationItemEntity[] items = {
                new NavigationBar.NavigationItemEntity(TestBaseFragmentActivity.this, R.string.nav_wonder,
                        R.mipmap.icon_share_normal, R.mipmap.icon_share_pressed),
                new NavigationBar.NavigationItemEntity(TestBaseFragmentActivity.this, R.string.nav_discovery,
                        R.mipmap.icon_discovery_normal, R.mipmap.icon_discovery_pressed),

                new NavigationBar.NavigationItemEntity("", null, null),

                new NavigationBar.NavigationItemEntity(TestBaseFragmentActivity.this, R.string.nav_message,
                        R.mipmap.icon_message_normal, R.mipmap.icon_message_pressed),
                new NavigationBar.NavigationItemEntity(TestBaseFragmentActivity.this, R.string.nav_me,
                        R.mipmap.icon_me_normal, R.mipmap.icon_me_pressed)
        };
        Fragment[] fragment = {WonderFragment.getInstance(), DiscoveryFragment.getInstance(), null,
                MessageFragment.getInstance(), MeFragment.getInstance()};
        setPageInfo(items, fragment, 0);



        getNavigationBar().setBackgroundResource(R.color.nav_background_color_CC000000);
        setNavigationBarTranslucent(true);
        getNavigationBar().setPadding(0, 0, 0, getResources().getDimensionPixelSize(R.dimen.nav_bar_button));
        getNavigationBar().setNavItemNamePxSize(18);
        getNavigationBar().setNavItemNameCheckedColor(getResources().getColor(R.color.orange_text_color_FC762D));
        getNavigationBar().setNavItemNameUncheckedColor(getResources().getColor(R.color.gray_text_color_868686));
        getNavigationBar().setNavItemNameIconPadding(10);
        getNavigationBar().setNavBarTopLineColor(Color.GRAY);
        getNavigationBar().setNavBarTopLineHeight(1);

        StateBitmapImageButton ball = new StateBitmapImageButton(this);
        ball.setImageResource(R.mipmap.icon_center_basketball_normal);
        ball.setBackgroundColor(Color.TRANSPARENT);
        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT);
        lp.addRule(RelativeLayout.CENTER_HORIZONTAL);
        lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        lp.bottomMargin = getResources().getDimensionPixelSize(R.dimen.nav_bar_ball);
        ball.setLayoutParams(lp);
        getLayoutView().addView(ball);
    }
}
